package com.arctic.coding.marvin;

import com.arctic.coding.marvin.car.CameraControl;
import com.arctic.coding.marvin.car.EngineControl;
import com.arctic.coding.marvin.car.WheelControl;

import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.Motor;

public class Marvin {
	

	public static void main(String[] args) throws InterruptedException {
		
		try {
						
			ControlServer server = new ControlServer(new EngineControl(Motor.C), new WheelControl(Motor.B), new CameraControl(Motor.A));
			server.start();
			
			while (Button.waitForAnyPress() != Button.ID_ESCAPE) {
				
			}
				
			server.interrupt();
				
			System.exit(0);
			
		} catch (Exception ex){
			LCD.drawString("Fehler:" + ex.getMessage(), 0, 4);
		}
		
	}
	
	

}
